<template>
	<view class="page">
		<view class="body" v-if="type == 1">
			<view class="input">
				<section>支付宝APPID</section>
				<view class="input_bj">
					<input type="text" placeholder="请输入APPID" class="input_bj_cont" />
				</view>
			</view>
			<view class="input">
				<section>商户秘钥</section>
				<view class="input_bj">
					<textarea placeholder="请输入" maxlength="-1" class="input_bj_cont">
					</textarea>
				</view>
			</view>
			<view class="input">
				<section>支付宝秘钥</section>
				<view class="input_bj">
					<textarea placeholder="请输入" maxlength="-1" class="input_bj_cont">
					</textarea>
				</view>
			</view>
			<view class="input">
				<section>是否启用</section>
				<view class="input_bj">
					<switch checked="checked" @change="change" />
				</view>
			</view>
		</view>
		<view class="body" v-if="type == 0">
			<view class="input">
				<section>微信支付APPID</section>
				<view class="input_bj">
					<input type="text" placeholder="请输入APPID" class="input_bj_cont" />
				</view>
			</view>
			<view class="input">
				<section>微信支付商户号</section>
				<view class="input_bj">
					<textarea placeholder="请输入商户号" maxlength="-1" class="input_bj_cont">
					</textarea>
				</view>
			</view>
			<view class="input">
				<section>微信支付秘钥</section>
				<view class="input_bj">
					<textarea placeholder="请输入" maxlength="-1" class="input_bj_cont">
					</textarea>
				</view>
			</view>
			<view class="input">
				<section>公众号secret(仅JSAPI支付的时候需要配置)</section>
				<view class="input_bj">
					<textarea placeholder="请输入" maxlength="-1" class="input_bj_cont">
					</textarea>
				</view>
			</view>
			<view class="input">
				<section>是否启用</section>
				<view class="input_bj">
					<switch checked="checked" @change="change" />
				</view>
			</view>
		</view>
		<view class="btn" style="margin-top: 50px;">
			确认
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '',
				checked: true
			}
		},
		onLoad(e) {
			this.type = e.type
			if (e.type == 1) {
				uni.setNavigationBarTitle({
					title: '支付宝配置'
				})
			} else {
				uni.setNavigationBarTitle({
					title: '微信配置'
				})
			}
		},
		methods: {
			change(e) {
				this.checked = e.detail.value
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		.body {
			.input {
				.input_bj {
					padding: 30rpx 0;

					.input_bj_cont {
						background-color: #f4f6fa;
						padding: 30rpx 20rpx;
						height: 150rpx;
						border-radius: 30rpx;
					}
				}
			}
		}
	}
</style>